import axios from "../index.js";

// start资源调配首页
// 调配统计
export const getReserveByGroup = (data) => {
  return axios.request({
    url: "/resource/baseResourceReserve/getReserveByGroup",
    method: "get",
    data: data
  });
};
// 分类统计
export const getReserveByOccupation = (data) => {
  return axios.request({
    url: "/resource/baseResourceReserve/getReserveByOccupation",
    method: "get",
    data: data
  });
};
// 饼图统计
export const getReserveTopPie = (data) => {
  return axios.request({
    url: "/resource/baseResourceReserve/getReserveTop3",
    method: "get",
    data: data
  });
};
// 各单位可调配资源表
export const allocationHome = (data) => {
  return axios.request({
    url: "/resource/baseResourceReserve/allocationHome",
    method: "post",
    data: data
  });
};

// end资源调配首页

// 资源申请列表
export const GetRequestList = (data) => {
  return axios.request({
    url: "/emergency/emergencyResourceAllocation/apply/listPage",
    method: "post",
    data: data
  });
};
// 已发布命令单数据接口
export const GetResponse = (data) => {
  return axios.request({
    url: "/emergency/emergencyResponse/selectResponse",
    method: "get",
    data: data
  });
};

// 资源申请需求等级
export const GetDemandLevel = (data) => {
  return axios.request({
    url: "/emergency/emergencyResourceAllocation/apply/demandLevel",
    method: "post",
    data: data
  });
};
// 资源申请列表保存/修改/提交
export const SaveOrSubmit = (data, ulrs) => {
  return axios.request({
    url: "/emergency/emergencyResourceAllocation/apply/" + ulrs,
    method: "post",
    data: data
  });
};
// 资源申请列表编辑
export const ResourceUpdate = (data) => {
  return axios.request({
    url: "/emergency/emergencyResourceAllocation/apply/updById",
    method: "post",
    data: data
  });
};
// 资源申请详情
export const GetApplyDetail = (data) => {
  return axios.request({
    url: "/emergency/emergencyResourceAllocation/apply/getById",
    method: "get",
    data: data
  });
};
// 资源申请删除
export const ResourceDeleted = (data) => {
  return axios.request({
    url: "/emergency/emergencyResourceAllocation/apply/deleteById",
    method: "get",
    data: data
  });
};
// 资源申请审批
export const ResourceApprove = (data) => {
  return axios.request({
    url: "/emergency/emergencyResourceAllocation/apply/approve",
    method: "post",
    data: data
  });
};

// 资源派遣列表
export const GetDispacthList = (data) => {
  return axios.request({
    url: "/emergency/emergencyResourceAllocation/dispatched/listPage",
    method: "post",
    data: data
  });
};

// 资源派遣提交，下发，保存，修改
export const SendDispacthList = (data, url) => {
  return axios.request({
    url: "/emergency/emergencyResourceAllocation/dispatched/" + url,
    method: "post",
    data: data
  });
};

// 资源派遣详情
export const GetDispacthDetail = (data) => {
  return axios.request({
    url: "/emergency/emergencyResourceAllocation/dispatched/getById",
    method: "get",
    data: data
  });
};

// 资源派遣审批
export const GetApplyAction = (data) => {
  return axios.request({
    url: "/emergency/emergencyAction/listPage",
    method: "post",
    data: data
  });
};



// 资源派遣审批
// export const DispacthApprove = (data) => {
//   return axios.request({
//     url: "/emergency/emergencyResourceAllocation/dispatched/approve",
//     method: "post",
//     data: data
//   });
// };

// 第一次审批
export const DispacthApproveOne = (data) => {
  return axios.request({
    url: "/emergency/emergencyResourceAllocation/apply/approveApplyOne",
    method: "post",
    data: data
  });
};
// 第一次审批
export const DispacthApproveTwo = (data) => {
  return axios.request({
    url: "/emergency/emergencyResourceAllocation/apply/approveApplyTwo",
    method: "post",
    data: data
  });
};



// 资源派遣详情
export const DispacthDeleted = (data) => {
  return axios.request({
    url: "/emergency/emergencyResourceAllocation/dispatched/deleteById",
    method: "get",
    data: data
  });
};
// 选择队伍列表
export const GetTeamResource = (data) => {
  return axios.request({
    url: "/resource/baseResourceTeam/listPage",
    method: "post",
    data: data
  });
};
// 队员选择
export const GetTeamMemberResource = (data) => {
  return axios.request({
    url: "/resource/baseResourceMember/listPage",
    method: "post",
    data: data
  });
};
// 资源仓库  vehicle-车辆，equ-装备，supplies-物资
export const GetResourceWarehouse = (data) => {
  return axios.request({
    url: "/resource/baseResourceWarehouse/listPage",
    method: "post",
    data: data
  });
};

// 筛选装备，物资仓库名称接口
export const getWarehouseName = (data) => {
  return axios.request({
    url: "/resource/baseResourceWarehouse/getWarehouseName",
    method: "get",
    data: data
  });
};

// 车辆选择列表
export const GetVehicleResource = (data) => {
  return axios.request({
    url: "/resource/baseResourceVehicle/listPage",
    method: "post",
    data: data
  });
};
// 装备选择列表
export const GetEquipResource = (data) => {
  return axios.request({
    url: "/resource/baseResourceEquip/listPage",
    method: "post",
    data: data
  });
};
// 物资选择列表
export const GetSuppliesResource = (data) => {
  return axios.request({
    url: "/resource/baseResourceSupplies/listPage",
    method: "post",
    data: data
  });
};


// 资源队伍申请下拉字典 teamType-队伍类型, teamMajor-队伍专业, teamNature-队伍性质
export const GetListTeamType = (data) => {
  return axios.request({
    url: "/resource/baseResourceTeam/listTeamType",
    method: "get",
    data: data
  });
};

// 资源队员申请下拉字典 人员专业-memberMajor,人员性质-memberType, 人员资质-personnelQualification,,memberAbility-特种作战能力
export const selectQueryParam = (data) => {
  return axios.request({
    url: "/resource/baseResourceMember/selectQueryParam",
    method: "get",
    data: data
  });
};

// 资源车辆申请下拉字典 车辆性质-properties, 车辆用途-usage, 车辆类型-type 查询
export const GetListCarType = (data) => {
  return axios.request({
    url: "/resource/baseResourceVehicle/listVehicleProperties",
    method: "get",
    data: data
  });
};

// 资源装备申请下拉字典
// export const GetListEquipmentType = (data) => {
//   return axios.request({
//     url: "/emergency/baseResourceEquip/listLargeCategory",  // 装备，物资共用
//     method: "get",
//     data: data
//   });
// };
export const GetListEquipmentType = (data) => {
  return axios.request({
    url: "/resource/baseResourceEquip/listEquipParam",
    method: "get",
    data: data
  });
};

// 资源物资申请下拉字典
export const GetListSuppliesType = (data) => {
  return axios.request({
    url: "resource/baseResourceSupplies/listSuppliesParam",
    method: "get",
    data: data
  });
};



// 资源投入统计// 资源投入统计// 资源投入统计// 资源投入统计
// 资源投入统计列表
export const ResourceList = (data) => {
  return axios.request({
    url: "/emergency/resourceInputStatistics/getTotal",
    method: "post",
    data: data
  });
};
// 人员投入统计
export const Members = (data) => {
  return axios.request({
    url: "/emergency/resourceInputStatistics/getMemberStatistic",
    method: "get",
    data: data
  });
};
// 车辆资源投入统计
export const Vehicle = (data) => {
  return axios.request({
    url: "/emergency/resourceInputStatistics/getVehicleStatistic",
    method: "get",
    data: data
  });
};
// 装备资源投入统计
export const Equip = (data) => {
  return axios.request({
    url: "/emergency/resourceInputStatistics/getEquipStatistic",
    method: "get",
    data: data
  });
};
// 物资资源投入统计
export const Supplies = (data) => {
  return axios.request({
    url: "/emergency/resourceInputStatistics/getSuppliesStatistic",
    method: "get",
    data: data
  });
};
